/*
 * File:        bufferNode.h
 * Authors:     Jonathan Kotker (ee122-bw) and Shaan Mulchandani (ee122-bv)
 * Description: This header file specifies a node of a buffer list. It
 *              contains a mapping between a file descriptor and the buffer
 *              associated with that descriptor.
 */

#ifndef _BUFFERLISTNODE_H
#define	_BUFFERLISTNODE_H

#include "constants.h"

struct bufferListNode {

    /* File descriptor associated with this buffer. */
    int fileDescriptor;

    /* Buffer to store incoming bytes. */
    char buffer[MAX_RECV_BUFFER_LEN];

    /* Position at which to store incoming bytes. */
    int incomingPosition;
    
    /* Pointer to the next node in the buffer list. */
    struct bufferListNode* next;

    /* Pointer to the previous node in the buffer list. */
    struct bufferListNode* prev;

};

typedef struct bufferListNode bufferListNode;

#endif	/* _BUFFERLISTNODE_H */

